#ifndef TESTDATA_H
#define TESTDATA_H

#include <QObject>
#include <QVector>
#include <QMap>
#include <QVariant>

class TestData : public QObject
{
    Q_OBJECT
public:
    explicit TestData(QObject *parent = nullptr);

    // 获取测试数据
    QVector<QMap<QString, QVariant>> getData(int page, int pageSize,
                                           const QMap<QString, QVariant> &filters,
                                           const QString &sortField = QString(),
                                           Qt::SortOrder sortOrder = Qt::AscendingOrder) const;

    // 获取满足条件的总记录数
    int getTotalCount(const QMap<QString, QVariant> &filters) const;

private:
    // 生成测试数据
    void generateData();

    // 模拟数据库
    QVector<QMap<QString, QVariant>> m_allData;
};

#endif // TESTDATA_H
